{extend name='common/content' /}

{block name="button"}
<!--{if auth("$classuri/add")}-->
<!-- <button data-open='{:url("$classuri/add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button> -->
<!--{/if}-->

<!--{if auth("$classuri/del")}-->
<!-- <button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除</button> -->
<!--{/if}-->
{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form autocomplete="off" class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-inline">
            <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入名称" class="layui-input">
        </div>
    </div>

    <!--{if !empty($members)}-->
    <div class="layui-form-item  layui-inline">
        <label class="layui-form-label">用户</label>
        <div class="layui-input-inline">
            <select name="uid" lay-verify="required" lay-search>
                <option value="">请选择用户</option>
                {foreach $members as $m}
                <!--{if $Think.get.uid eq $m.id}-->
                <option selected="selected" value="{$m.id}">{$m.username}</option>
                <!--{else}-->
                <option value="{$m.id}">{$m.username}</option>
                <!--{/if}-->
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

    <!--{if !empty($machines)}-->
    <div class="layui-form-item  layui-inline">
        <label class="layui-form-label">设备</label>
        <div class="layui-input-inline">
            <select name="mid" lay-verify="required" lay-search>
                <option value="">请选择设备</option>
                {foreach $machines as $m}
                <!--{if $Think.get.mid eq $m.id}-->
                <option selected="selected" value="{$m.id}">{$m.title}</option>
                <!--{else}-->
                <option value="{$m.id}">{$m.title}</option>
                <!--{/if}-->
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}" placeholder="请选择时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<script>
    window.laydate.render({range: true, elem: '#range-date'});
</script>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <!--{empty name='list'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
<!--             <th class='list-table-check-td think-checkbox'>
                <input data-auto-none="" data-check-target='.list-check-box' type='checkbox'>
            </th> -->
            <th class='text-left nowrap'>名 称</th>
            <th class='text-left nowrap'>用 户</th>
            <th class='text-left nowrap'>设 备</th>
            <th class='text-left nowrap'>开 始 时 间</th>
            <th class='text-left nowrap'>结 束 时 间</th>
            <!-- <th class='text-left nowrap'>操 作</th> -->
        </tr>
        </thead>
        <tbody>
        <!--{foreach $list as $key=>$vo}-->
        <tr title="{$vo.title|default=''}">
<!--             <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td> -->
            <td class='text-left nowrap'>
                {$vo.title|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.uid|default='<span class="color-desc">未设置</span>'|raw|get_model_value='Member','truename'}
            </td>
            <td class='text-left nowrap'>
                {$vo.mid|default='<span class="color-desc">未设置</span>'|raw|get_model_value='Machine','title'}
            </td>
            <td class='text-left nowrap'>
                {$vo.start_at|date='Y-m-d H:i:s'}
            </td>
            <td class='text-left nowrap'>
                {$vo.end_at|date='Y-m-d H:i:s'}
            </td>
            <td class='text-left nowrap'>

<!--                 {if auth("$classuri/edit")}
                <span class="text-explode">|</span>
                <a data-title="编辑" data-open='{:url("$classuri/edit")}?id={$vo.id}'>编辑</a>
                {/if} -->

<!--                 {if auth("$classuri/del")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'>删除</a>
                {/if} -->

            </td>
        </tr>
        <!--{/foreach}-->
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/empty}-->
</form>
<script>
    (function () {
        window.form.render();
        window.laydate.render({range: true, elem: '#create_at'});
    })();
</script>
{/block}